﻿using System.ComponentModel;
using Util;

namespace IterationLife.Extensions.Enums
{
    /// <summary>
    /// 学期类型
    /// </summary>
    public enum SemesterType
    {
        /// <summary>
        /// 上学期
        /// </summary>
        [Description("上学期")]
        Last = 1,
        /// <summary>
        /// 下学期
        /// </summary>
        [Description("下学期")]
        Next= 2
    }

    /// <summary>
    /// 学期类型枚举扩展
    /// </summary>
    public static class SemesterTypeExtensions
    {
        /// <summary>
        /// 获取描述
        /// </summary>
        public static string Description(this FileType? type)
        {
            return type == null ? string.Empty : type.Value.Description();
        }

        /// <summary>
        /// 获取值
        /// </summary>
        public static int? Value(this FileType? type)
        {
            return type?.Value();
        }
    }
}
